#include "StdAfx.h"
#include "PaddingPanelUI.h"

CPaddingPanelUI::CPaddingPanelUI(void)
{
	m_cxyFixed.cx = m_cxyFixed.cy = 0;
}

CPaddingPanelUI::CPaddingPanelUI(int cx, int cy)
{
	m_cxyFixed.cx = cx;
	m_cxyFixed.cy = cy;
}

CPaddingPanelUI::~CPaddingPanelUI(void)
{
}

void CPaddingPanelUI::SetWidth(int cxWidth)
{
	m_cxyFixed.cx = cxWidth;
	UpdateLayout();
}

void CPaddingPanelUI::SetHeight(int cyHeight)
{
	m_cxyFixed.cy = cyHeight;
	UpdateLayout();
}

void CPaddingPanelUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
{
	if( _tcscmp(pstrName, _T("width")) == 0 ) SetWidth(_ttoi(pstrValue));
	else if( _tcscmp(pstrName, _T("height")) == 0 ) SetHeight(_ttoi(pstrValue));
	else CControlUI::SetAttribute(pstrName, pstrValue);
}

LPCTSTR CPaddingPanelUI::GetClass() const
{
	return _T("PaddingPanel");
}

SIZE CPaddingPanelUI::EstimateSize(SIZE szAvailable)
{
	return m_cxyFixed;
}

void CPaddingPanelUI::DoPaint(HDC hDC, const RECT& rcPaint)
{
}
